package java69.work717_2;


import java.util.Scanner;

public class Student {
    private String name;
    private int age;
    private String address;
    private String zipCode;
    private String mobile;

    public Student() {
    }
    public Student(String name, int age, String address, String zipCode, String mobile) {
        this.address = address;
        this.age = age;
        this.mobile = mobile;
        this.name = name;
        this.zipCode = zipCode;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getZipCode() {
        return zipCode;
    }

    public void setZipCode(String zipCode) {
        this.zipCode = zipCode;
    }

    public String getMobile() {
        return mobile;
    }

    public void setMobile(String mobile) {
        this.mobile = mobile;
    }

    public  void  getPostAddress(){
        System.out.println("地址："+getAddress()+"，邮编："+getZipCode());
    }


    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        Student[] st = new Student[]{
          new Student("小明",15,"合肥","23100","11111111111"),
                new Student("小王",16,"肥西","23120","13331111111"),
                new Student("小光",17,"肥东","23110","11111177711"),
        };
        System.out.println("请输入你要查的人的名字：");
        String name = sc.next();
        int i = 0;
        for (; i <st.length ; i++) {
            if (name.equals(st[i].name)){
                st[i].getPostAddress();
                break;
            }
        }
        if (i>=st.length){
            System.out.println("该人不存在！");
        }

    }
}
